package org.sbbs.base.dao.hibernate;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.EmptyInterceptor;

public class CusEmptyInterceptor
    extends EmptyInterceptor {
    protected final Log log = LogFactory.getLog( getClass() );

    @Override
    public String onPrepareStatement( String sql ) {
        log.debug( sql );
        sql = testTagSql( sql );
        return super.onPrepareStatement( sql );
    }

    
    
    private String testTagSql(String sql){
        
        sql = sql.replaceAll( "1=1", "2=2" );
        return sql;
        
    }
}
